import Weapon from "./weapon.js"

class Wall extends Weapon {
    constructor(game, row, col, config) {
        super(game, row, col, config);
    }

    draw(preview) {
        let game = this.game;
        if (!this.map_cell) return;

        let weapon = game.weapon_utils.find_weapon(this.row, this.col);
        if (preview && (weapon || this.map_cell.is_start_end_cell())) {
            this.map_cell.draw_mark("deny");
            return;
        }
        this.map_cell.draw_mark(preview ? "preview" : "wall");
    };

    fire() {
    };
}

// Empty ========================================
class Empty extends Wall {
    constructor(game, row, col, config) {
        super(game, row, col, config);
    }

    draw(preview) {
        if (!this.map_cell) return;
        this.map_cell.draw_mark("empty");
    };
}

// Drop ========================================
class Drop extends Wall {
    constructor(game, row, col, config) {
        super(game, row, col, config);
    }

    draw(preview, show_deny) {
        if (!this.map_cell) return;

        let game = this.game;
        let weapon = game.weapon_utils.find_weapon(this.row, this.col);
        if (!weapon) return;

        this.map_cell.draw_mark(show_deny ? "deny" : "drop");
    };
}

export {Wall, Empty, Drop}